#ifndef GULLENGINE_CAMERANODE_H
#define GULLENGINE_CAMERANODE_H

#include "SceneNode.h"
#include "TransformController.h"



namespace gull {
	namespace core {
		
		
		class CameraNode : public SceneNode {
			
		public:
			CameraNode(const char* name);
			CameraNode(const CameraNode& cam);
			~CameraNode();
			
			inline const Vector3D* getPosition() const;
			inline void setPosition(const Vector3D& v);
			inline const Vector3D* getCameraUp() const;
			inline void setCameraUp(const Vector3D& v) const;
			inline const Vector3D getCameraLookAt() const;
			inline void setCameraLookAt(const Vector3D& v);
			

			
			
			virtual gullNotification render(Scene* scene) ;
			//virtual gullNotification preRender(Scene* scene) ;
//			virtual gullNotification postRender(Scene* scene) ;
			
			
		protected:
			
		private:
		};
		
		
		
		const Vector3D* 
		CameraNode::getCameraUp() const{
			const TransformController* tr = static_cast<const TransformController*>(getController(TRANSFORM));
			return &((*tr->getTransform())[1]);
		}
		
		void 
		CameraNode::setCameraUp(const Vector3D& v) const{
			
		}
		
		const Vector3D 
		CameraNode::getCameraLookAt() const{
			const TransformController* tr = static_cast<const TransformController*>(getController(TRANSFORM));
			return Vector3D(-((*tr->getTransform())[2]));
		}
		
		void 
		CameraNode::setCameraLookAt(const Vector3D& v){
			
		}
		
		void
		CameraNode::setPosition(const Vector3D& v){
			TransformController* tr = static_cast<TransformController*>(getController(TRANSFORM));
			(*tr->getTransform())[3] = v;
		}
		
		const Vector3D*
		CameraNode::getPosition() const{
			const TransformController* tr = static_cast<const TransformController*>(getController(TRANSFORM));
			return &((*tr->getTransform())[3]);
		}
		
	}
}


#endif